package com.zjx.ssmdemo.ssm.service.impl;

import com.zjx.ssmdemo.ssm.dao.IUserDao;
import com.zjx.ssmdemo.ssm.entity.User;
import com.zjx.ssmdemo.ssm.service.IUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class IUserServiceImpl implements IUserService {

    @Resource
    private IUserDao userDao;
    @Override
    public List<User> queryAll() {
        return userDao.queryAll();
    }

    @Override
    public User querybyId(int userid) {
        return userDao.querybyId(userid);
    }

    @Override
    public void insertUser(User user) {
          userDao.insertUser(user);
    }



    @Override
    public int updateUserbyId(@Param("userId") long userId, @Param("username") String username) {

        return userDao.updateUserbyId(userId,username);
    }


}
